<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/vue.js"></script>
</head>

<body>
    <div id="root" @submit.prevent='demo()'>
        账号：<input type="text" v-model.trim="info.text"> <br/><br/> 密码：
        <input type="password" v-model.trim="info.password"> <br/><br/> 性别：男
        <input type="radio" v-model='info.sex' value="male"> 女
        <input type="radio" v-model='info.sex' value="female"><br><br> 爱好：抽烟
        <input type="checkbox" v-model="info.hoddy" value="chouyan"> 喝酒
        <input type="checkbox" value="dirve"> 烫头
        <input type="checkbox" value="head"><br><br> 所属校区：
        <select v-model="info.city">
        <option value="">北京</option>
        <option value="shanghai">上海</option>
        <option value="shenzhen">深圳</option>
        <option value="tianjin">天津</option>
        </select><br><br> 其他信息:
        <textarea v-model.lazy="info.other"></textarea><br><br>
        <input type="checkbox" v-model="info.agree">阅读并接受<a href="#">《用户协议》</a>
        <button>提交</button>
    </div>
    <script>
        new Vue({
            el: '#root',
            data: {
                info: {
                    text: '',
                    password: '',
                    sex: '',
                    hoddy: [],
                    city: '',
                    other: '',
                    agree: '',


                }
            },
            methods: {
                demo() {
                    console.log(JSON.stringify(this.info))
                }
            }
        })
    </script>
</body>

</html>